package edu.zqu.instructionalMatters.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.zqu.instructionalMatters.project.entity.Semester;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author 何文东
 * @Date 2020-07-03
 * @Description: 学期 - Mapper 接口
 * @Version 1.0
 */
public interface SemesterMapper extends BaseMapper<Semester> {
    @Select("<script>" + "select * from semester where college_id = #{collegeId}" +
            " <if test = 'name != null'>" +
            " and name like concat('%',#{name},'%')" +
            " </if>" +
            " <if test = 'englishName != null'>" +
            " and english_name like concat('%',#{englishName},'%')" +
            " </if>"
            + "</script>")
    public List<Semester> findAll(Semester semester);
}
